/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.Acomedica;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;



public class Conexion {
   
//atributos   

    private String bd = "acomedic";
    private String login = "Adm_acomedic";
    private String password = "7486764k";
    private String url = "jdbc:mysql://localhost/"+bd;
    
    Connection canal = null;

//contructor    
public Conexion(){
        try {
            try {
                Class.forName("com.mysql.jdbc.Driver");
            } catch (ClassNotFoundException ex) {
                ex.getMessage();
            }
            canal=DriverManager.getConnection(url,login,password);
        } catch (SQLException ex) {
            ex.getMessage();
        }
       
    
      
  }
//metodos  
   
   public Connection getConnection(){
      return canal;
   }
  
   public void desconectar(){
      canal = null;
   }
}
